package me.snowiest.snowdrift.entity;

import java.time.LocalDate;
import java.io.Serializable;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
@ApiModel("用户信息")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId
    private Integer id;

    @TableField
    private String username;

    @JSONField(serialize = false)
    private String password;

    @TableField(value = "creationTime", fill = FieldFill.INSERT)
    private LocalDate gmtCreate;

    @TableField(value = "modificationTime", fill = FieldFill.INSERT_UPDATE)
    private LocalDate gmtModified;

    @TableLogic
    @JSONField(serialize = false)
    private Integer deleted;

    @Version
    @JSONField(serialize = false)
    private Integer version;
}
